home *** CD-ROM | disk | FTP | other *** search
- /*
- MyFgets.c
-
- A version of fgets() that, like gets(), strips the trailing '\n'.
- Please DON'T use this. It was a BAD idea.
-
- HISTORY:
- god knows when dgp wrote it.
- 12/1/92 dgp fixed stupid error of deleting last character without first
- making sure that it's an '\n'
- */
- #include "VideoToolbox.h"
-
- char *MyFgets(char *s, int length, FILE *stream)
- {
- int i;
-
- fgets(s,length,stream);
- i=strlen(s);
- if(i>0 && i<length && s[i-1]=='\n') s[i-1]=0; /* strip trailing "\n" */
- return s;
- }